//
//  STDSRenderView.h
//  STDRenderSDK
//
//  Created by 陈学明 on 2023/3/16.
//

#import <UIKit/UIKit.h>
#import "STDSRenderer.h"
NS_ASSUME_NONNULL_BEGIN

@class STDSRenderView;
@protocol STDSRenderViewDelegate <NSObject>

- (void)onReadyRenderView:(STDSRenderView *)view;
@end

@interface STDSRenderView : UIView
@property (nonatomic, strong, readonly) STDSRenderer *renderer;
@property (nonatomic, weak) id<STDSRenderViewDelegate>delegate;

- (instancetype)initWithFrame:(CGRect)frame composeSize:(CGSize)composeSize;

- (void)renderPrograss:(CGFloat)prograss;

- (void)render;

- (STDSGLImageParam *)addImageLayerWithImagePath:(nullable NSString *)imagePath;

- (void)replaceLayerAssetImgPath:(nullable NSString *)path;

- (void)replaceLayerAssetImgPath:(nullable NSString *)path layerID:(int)layerID;

- (void)replaceLayerTextureID:(unsigned int)textureID width:(CGFloat)width height:(CGFloat)height;

- (void)replaceLayerData:(unsigned char *)data width:(CGFloat)width height:(CGFloat)height;

- (void)addEffectType:(STDSEffectType)effectType;

- (void)destroy;

- (void)onRendererThreadBlock:(void(^)(STDSRenderView *renderView))block;

- (CALayer *)glLayer;

- (void)takeImageWithComplate:(void(^)(UIImage *image))complate;

- (void)testGL;
@end

NS_ASSUME_NONNULL_END
